package com.ys.web.mobao.service;

import com.ys.web.mobao.mapper.MobaoWithholdingMapper;
import com.ys.web.pay.model.WithdrawRecord;
import com.ys.web.pay.model.WithdrawRecordWait;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MobaoWithholdingService {
    @Autowired
    private MobaoWithholdingMapper mobaoWithholdingMapper;

    public int getUserWhiteByUid(long uid){return mobaoWithholdingMapper.getUserWhiteByUid(uid);}

    public void saveWithdrawRecord(WithdrawRecord record){mobaoWithholdingMapper.saveWithdrawRecord(record);}
    public void saveWithdrawRecordWait(WithdrawRecordWait record){mobaoWithholdingMapper.saveWithdrawRecordWait(record);}

    public WithdrawRecord getWithdrawRecordByOrderId(String orderId){return mobaoWithholdingMapper.getWithdrawRecordByOrderId(orderId);}

    public WithdrawRecordWait getWithdrawRecordWaitById(String id){return mobaoWithholdingMapper.getWithdrawRecordWaitById(id);}

    public int updateWithdrawRecordByOrderId(WithdrawRecord record){
        return mobaoWithholdingMapper.updateWithdrawRecordByOrderId(record);
    }
    public int updateWithdrawRecordTask(WithdrawRecord record){
        return mobaoWithholdingMapper.updateWithdrawRecordTask(record);
    }

    public int updateWithdrawRecordWaitByOrderId(WithdrawRecord record){
        return mobaoWithholdingMapper.updateWithdrawRecordWaitByOrderId(record);
    }
    public List<WithdrawRecord> getWithdrawRecordListByTime(){return mobaoWithholdingMapper.getWithdrawRecordListByTime();}

    public int getWithdrawRecordWaitCountByUid(long uid){
        return mobaoWithholdingMapper.getWithdrawRecordWaitCountByUid(uid);
    }

    public int withholdingSuccess(long id, String status) {
        return mobaoWithholdingMapper.withholdingSuccess(id,status);
    }
    public int withholdingStatus(long id, String status) {
        return mobaoWithholdingMapper.withholdingStatus(id,status);
    }
    public int insertSxf(String requestNo, long uid, String orderNo, long amount, long fee, long dayTime, int status, String remark) {
        return mobaoWithholdingMapper.insertSxf(requestNo,uid,orderNo,amount,fee,dayTime,status,remark);
    }
    public int insertSxfMb(String requestNo, long uid, String orderNo, long amount, long fee, long dayTime, int status, String remark) {
        return mobaoWithholdingMapper.insertSxfMb(requestNo,uid,orderNo,amount,fee,dayTime,status,remark);
    }
    public int updateSxf(String orderNo, int status, String remark) {
        return mobaoWithholdingMapper.updateSxf(orderNo,status,remark);
    }

    public List<WithdrawRecordWait> getWithdrawRecordListTask(long dayTime) {
        return mobaoWithholdingMapper.getWithdrawRecordListTask(dayTime);
    }

    public int orderOutNoUpdate(long id, String orderOutNo, String payFundOrderId,String status,int dayKey) {
        return mobaoWithholdingMapper.orderOutNoUpdate(id,orderOutNo,payFundOrderId,status,dayKey);
    }

    public int withholdingStatus(long id, String status,String errMsg) {
        return mobaoWithholdingMapper.withholdingErrMsgStatus(id,status,errMsg);
    }

    public int updateWithdrawRecordStatus(WithdrawRecord withdrawRecord) {
        return mobaoWithholdingMapper.updateWithdrawRecordStatus(withdrawRecord);
    }
    public int updateWithdrawRecordStatusTask(WithdrawRecord withdrawRecord) {
        return mobaoWithholdingMapper.updateWithdrawRecordStatusTask(withdrawRecord);
    }
    public int getWithdrawNum(long uid) {
        return mobaoWithholdingMapper.getWithdrawNum(uid);
    }

}
